{aide_template 'common/header-base'}
{if !MERCHANTID}
{php $frames = buildframes(FRAME);_calc_current_frames($frames);}
{php $aideUrl=aide_URL};
{/if}
<div class="skin-black" data-skin="black">
<div class="head">
	<nav class="navbar navbar-default" role="navigation">
		<div class="container {if !empty($frames['section']['platform_module_menu']['plugin_menu'])}plugin-head{/if}">
			<div class="navbar-header">
				<a class="navbar-brand" href="{if !MERCHANTID}{$_W['siteroot']}{else}{php echo $aideUrl . 'web/merch.php';}{/if}">
					<img src="{if !empty($_W['setting']['copyright']['blogo'])}{php echo tomedia($_W['setting']['copyright']['blogo'])}{else}{$_W['siteroot']}web/resource/images/logo/logo.png{/if}" class="pull-left" width="110px" height="35px">
				</a>
			</div>
            <style>.head .navbar-right, .head .navbar-left,.navbar-nav > li > a{ font-size:inherit; line-height:25px;}</style>
			{if !empty($_W['uid']) || $_SESSION['role']=='merchant'}
			<div class="collapse navbar-collapse">
				{if $_SESSION['role']=='merchant'}
                <ul class="nav navbar-nav navbar-left">
                    <li{if $_GPC['ac']=='merchant'} class="active"{/if}><a href="{php echo web_url('application/merchant/setting')}"><i class="fa fa-desktop"></i>&nbsp;&nbsp; 主办方中心</a></li>
                    <li{if $_GPC['ac']=='activity'} class="active"{/if}><a href="{php echo web_url('activity/activity/display')}"><i class="fa fa-gift"></i>&nbsp;&nbsp; 活动管理</a></li>
                    <li{if $_GPC['ac']=='records'} class="active"{/if}><a href="{php echo web_url('records/records/display')}"><i class="fa fa-list"></i>&nbsp;&nbsp; 报名管理</a></li>
				</ul>
			    <ul class="nav navbar-nav navbar-right">
					<li>
						<a href="javascript:;"  data-toggle="dropdown" style="display:block; max-width:200px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><img src="{php echo tomedia($_SESSION['role_logo'])}?time={php echo time()}" class="img-responsive img-thumbnail" width="30"/> {$_SESSION['role_name']} </a>
					</li>
					<li>
						<a href="{php echo web_url('user/logout');}" style="display:block; max-width:185px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-sign-out"></i>退出系统 </a>
					</li>
				</ul>
			    {else}
                <ul class="nav navbar-nav navbar-left">
					<li{if $_GPC['ac']=='welcome'} class="active"{/if}><a href="{php echo url('platform/cover', array('eid' => $entries['cover'][0]['eid'], 'version_id' => 0))}"><i class="fa fa-home"></i>&nbsp;&nbsp; 首页</a></li>
                    <li{if $_GPC['ac']=='activity'} class="active"{/if}><a href="{php echo web_url('activity/activity/display')}"><i class="fa fa-gift"></i>&nbsp;&nbsp; 活动管理</a></li>
                    <li{if $_GPC['ac']=='records'} class="active"{/if}><a href="{php echo web_url('records/records/display')}"><i class="fa fa-list"></i>&nbsp;&nbsp; 报名管理</a></li>
                    <li{if $_GPC['ac']=='member'} class="active"{/if}><a href="{php echo web_url('member/member/display')}"><i class="fa fa-user"></i>&nbsp;&nbsp; 会员管理</a></li>
                    <li{if $_GPC['ac']=='merchant'} class="active"{/if}><a href="{php echo web_url('application/merchant/display')}"><i class="fa fa-archive"></i>&nbsp;&nbsp; 主办方管理</a></li>
				</ul>
				<ul class="nav navbar-nav navbar-right">
					<li class="dropdown">
						<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"><i class="wi wi-user color-gray"></i>{$_W['user']['username']} <span class="caret"></span></a>
						<ul class="dropdown-menu color-gray" role="menu">
							<li>
								<a href="{url 'user/profile'}" target="_blank"><i class="wi wi-account color-gray"></i> 我的账号</a>
							</li>
							{if $_W['isfounder']}
							<li class="divider"></li>
							{if uni_user_see_more_info(ACCOUNT_MANAGE_NAME_VICE_FOUNDER, false)}
							<li><a href="{url 'cloud/upgrade'}" target="_blank"><i class="wi wi-update color-gray"></i> 自动更新</a></li>
							{/if}
							<li><a href="{url 'system/updatecache'}" target="_blank"><i class="wi wi-cache color-gray"></i> 更新缓存</a></li>
							<li class="divider"></li>
							{/if}
							<li>
								<a href="{url 'user/logout'}"><i class="fa fa-sign-out color-gray"></i> 退出系统</a>
							</li>
						</ul>
					</li>
				</ul>
                {/if}
			</div>
			{else}
			<div class="collapse navbar-collapse">
				<ul class="nav navbar-nav navbar-right">
					<li class="dropdown"><a href="{php echo url('user/register');}">注册</a></li>
					<li class="dropdown"><a href="{php echo url('user/login');}">登录</a></li>
				</ul>
			</div>
			{/if}
		</div>
	</nav>
</div>
<div class="main">
{if !defined('IN_MESSAGE')}
<div class="container">
	<div class="panel panel-content main-panel-content {if !empty($frames['section']['platform_module_menu']['plugin_menu'])}panel-content-plugin{/if}">
	<div class="panel-body clearfix main-panel-body {if !empty($_W['setting']['copyright']['leftmenufixed'])}menu-fixed{/if}">
		<div class="left-menu">
        {if $_SESSION['role']=='merchant' || $_GPC['c']=='site'}
        	{php aide_load()->func('tpl');}
            {php $getlistFrames = 'get'.$controller.'Frames';}
            {php $frames = $getlistFrames();}
            {php $frames = empty($frames) ? $GLOBALS['frames'] : $frames; _calc_current_frames2($frames);}
            <style>.left-menu .fa{width: 14px;}</style>
            <div class="left-menu-content">
				<div class="left-menu-top skin-black">
					{if $_SESSION['role']!='merchant'}
                        {if ($_GPC['c'] != 'cloud' && !empty($_GPC['m']) && !in_array($_GPC['m'], array('keyword', 'special', 'welcome', 'default', 'userapi', 'service'))) || defined('IN_MODULE')}
                            {aide_template 'common/header-module'}
                        {else}
                            {aide_template 'common/header-' . FRAME}
                        {/if}
                    {else}
                        {aide_template 'common/header-module'}
                    {/if}
				</div>
				{loop $frames $k $frame}
				<div class="panel panel-menu">
					<div class="panel-heading">
						<span class="" data-toggle="collapse" data-target="#frame-{$k}" onclick="util.cookie.set('menu_fold_tag:{$k}', util.cookie.get('menu_fold_tag:{$k}') == 1 ? 0 : 1)">{$frame['title']}<i class="wi wi-down-sign-s pull-right"></i></span>
					</div>
					<ul class="list-group collapse {if $k == 0}in{/if}" id="frame-{$k}">
						{loop $frame['items'] $link}
                            <li class="list-group-item {$link['active']}">
                                <a href="{$link['url']}" class="text-over">{$link['title']}</a>
                            </li>
						{/loop}
					</ul>
				</div>
				{/loop}
			</div>
		{else}
			{if empty($frames['section']['platform_module_menu']['plugin_menu'])}
			<div class="left-menu-content">
				<div class="left-menu-top skin-black">
					{if !empty($_GPC['m']) && !in_array($_GPC['m'], array('keyword', 'special', 'welcome', 'default', 'userapi', 'service')) || defined('IN_MODULE')}
						{aide_template 'common/header-module'}
					{else}
						{aide_template 'common/header-' . FRAME}
					{/if}
				</div>
				{loop $frames['section'] $frame_section_id $frame_section}
				{if !isset($frame_section['is_display']) || !empty($frame_section['is_display'])}
				<div class="panel panel-menu">
					{if $frame_section['title']}
					<div class="panel-heading">
						<span class="" data-toggle="collapse" data-target="#frame-{$frame_section_id}" onclick="util.cookie.set('menu_fold_tag:{$frame_section_id}', util.cookie.get('menu_fold_tag:{$frame_section_id}') == 1 ? 0 : 1)">{$frame_section['title']}<i class="wi wi-down-sign-s pull-right"></i></span>
					</div>
					{/if}
					<ul class="list-group collapse {if $_GPC['menu_fold_tag:'.$frame_section_id] == 0}in{/if}" id="frame-{$frame_section_id}">
						{loop $frame_section['menu'] $menu_id $menu}
						{if !empty($menu['is_display'])}
							{if $menu_id == 'platform_module_more'}
							<li class="list-group-item list-group-more">
								<a href="{url 'module/manage-account'}" target="_blank"><span class="label label-more">更多应用</span></a>
							</li>
							{else}
							<li class="list-group-item {if $menu['active']}active{/if}">
								<a href="{$menu['url']}" class="text-over" {if $frame_section_id == 'platform_module'}target="_blank"{/if}>
								{if $menu['icon']}
								{if $frame_section_id == 'platform_module'}
								<img src="{$menu['icon']}"/>
								{else}
								<i class="{$menu['icon']}"></i>
								{/if}
								{/if}
								{$menu['title']}
								</a>
							</li>
							{/if}
						{/if}
						{/loop}
					</ul>
				</div>
				{/if}
				{/loop}
			</div>
			{else}
				<div class="plugin-menu clearfix">
					<div class="plugin-menu-main pull-left">
						<ul class="list-group">
							<li class="list-group-item{if $_W['current_module']['name'] == $frames['section']['platform_module_menu']['plugin_menu']['main_module']} active{/if}">
								<a href="{php echo url('home/welcome/ext', array('m' => $frames['section']['platform_module_menu']['plugin_menu']['main_module']))}">
									<i class="wi wi-main-apply"></i>
									<div>主应用</div>
								</a>
							</li>
							<li class="list-group-item">
								<div>插件</div>
							</li>
							{loop $frames['section']['platform_module_menu']['plugin_menu']['menu'] $plugin_name $plugin}
							<li class="list-group-item{if $_W['current_module']['name'] == $plugin_name} active{/if}">
								<a href="{php echo url('home/welcome/ext', array('m' => $plugin_name))}">
									<img src="{$plugin['icon']}" alt="" class="img-icon" />
									<div>{$plugin['title']}</div>
								</a>
							</li>
							{/loop}
						</ul>
						{php unset($plugin_name);}
						{php unset($plugin);}
					</div>
					<div class="plugin-menu-sub pull-left">
						{loop $frames['section'] $frame_section_id $frame_section}
						{if !isset($frame_section['is_display']) || !empty($frame_section['is_display'])}
							<div class="panel panel-menu">
								{if $frame_section['title']}
								<div class="panel-heading">
									<span class="collapsed" data-toggle="collapse" data-target="#frame0-{$frame_section_id}" aria-expanded="true" aria-controls="frame0-{$frame_section_id}">{$frame_section['title']}<i class="wi wi-down-sign-s pull-right"></i></span>
								</div>
								{/if}
								<ul class="list-group panel-collapse collapse in" id="frame0-{$frame_section_id}">
									{loop $frame_section['menu'] $menu_id $menu}
									{if !empty($menu['is_display'])}
									{if $menu_id == 'platform_module_more'}
									<li class="list-group-item list-group-more">
										<a href="{url 'module/manage-account'}" target="_blank"><span class="label label-more">更多应用</span></a>
									</li>
									{else}
									<li class="list-group-item {if $menu['active']}active{/if}">
										<a href="{$menu['url']}" class="text-over" {if $frame_section_id == 'platform_module'}target="_blank"{/if}>
										{if $menu['icon']}
											{if $frame_section_id == 'platform_module'}
											<img src="{$menu['icon']}"/>
											{else}
											<i class="{$menu['icon']}"></i>
											{/if}
										{/if}
										{$menu['title']}
										</a>
									</li>
									{/if}
									{/if}
									{/loop}
								</ul>
							</div>
						{/if}
						{/loop}
					</div>
				</div>
			{/if}
        {/if}
		</div>
		<div class="right-content">
			<div class="content">
				<!--系统提示-->
				{if $_COOKIE['private_app_notice']}
				<div class="system-tips we7-body-alert">
					<div class="container text-right">
						<span class="alert-info">
							<a href="javascript:;">
								{$_COOKIE['private_app_notice']}
							</a>
							<span class="tips-close" onclick="check_setmeal_hide();" ><i class="wi wi-error-sign"></i></span>
						</span>
					</div>
				</div>
				{php setcookie('private_app_notice', '', -1);}
				{/if}
				<!--end  系统提示-->
				{if empty($_COOKIE['check_setmeal']) && !empty($_W['account']['endtime']) && ($_W['account']['endtime'] - TIMESTAMP < (6*86400))}
				<div class="system-tips we7-body-alert" id="setmeal-tips">
					<div class="container text-right">
						<div class="alert-info">
							<a href="{if $_W['isfounder']}{php echo url('user/edit', array('uid' => $_W['account']['uid']));}{else}javascript:void(0);{/if}">
								您的服务有效期限：{php echo date('Y-m-d', $_W['account']['starttime']);} ~ {php echo date('Y-m-d', $_W['account']['endtime']);}.
								{if $_W['account']['endtime'] < TIMESTAMP}
								目前已到期，请联系管理员续费
								{else}
								将在{php echo floor(($_W['account']['endtime'] - strtotime(date('Y-m-d')))/86400);}天后到期，请及时付费
								{/if}
							</a>
							<span class="tips-close" onclick="check_setmeal_hide();"><i class="wi wi-error-sign"></i></span>
						</div>
					</div>
				</div>
				<script>
					function check_setmeal_hide() {
						util.cookie.set('check_setmeal', 1, 1800);
						$('#setmeal-tips').hide();
						return false;
					}
				</script>
				{/if}
{/if}
